#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

int singleNumber(int* nums, int numsSize) {
    for (int i = 1; i < numsSize; i++) {
        nums[0] ^= nums[i];
    }
    return nums[0];
}


int main() {
    int nums[] = { 1, 1, 2, 2, 3, 4, 4};
    int nums1[] = { 1, 1, 2, 3, 2, 4, 4};
    int nums2[] = { 1, 2, 3, 2, 4, 4, 1};
    int res = singleNumber(nums2, sizeof(nums2) / sizeof(int));
    printf("res = %d\n", res);
    return 0;
}
